#ifndef __ILIB_IO_THREAD_H_20120212__
#define __ILIB_IO_THREAD_H_20120212__

#include "iMsgThread.h"
#include "iIOR.h"

#define MSG_IO_ADD	2012
#define MSG_IO_DEL	2013
class iIOThread : public iMsgThread
{
public:
	iIOThread();
	inline void add_io(iIO* io)
    {
        post_msg(iMsg::new_instance(MSG_IO_ADD, io, this), this);
    }
    inline void remove_io(iIO* io)
    {
        post_msg(iMsg::new_instance(MSG_IO_DEL, io, this), this);
    }
private:
	virtual int on_message(iMsgID msg, void* param);
	virtual int run();

protected:
	iIOEPoll*	m_io_runner;
};

#endif  //__ILIB_IO_THREAD_H_20120212__
